﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.Generic;
using System.IO.IsolatedStorage;
using System.Runtime.Serialization;

namespace SuperQuiz.Model
{
    [DataContract]
    public class Performance
    {
        [DataMember]
        public String TopicName { get; set; }
        [DataMember]
        public int Value { get; set; }
    }

    [DataContract]
    public class PerformanceData
    {
        [DataMember]
        public Dictionary<string, List<Performance> > Performances { get; set; }

        static public void LoadPerformance()
        {
            if (IsolatedStorageSettings.ApplicationSettings.Contains("data"))
            {
                Data = (PerformanceData)IsolatedStorageSettings.ApplicationSettings["data"];
                
            }
        }

        static public void SavePerformance()
        {
            if (Data != null)
            {
                IsolatedStorageSettings.ApplicationSettings["data"] = Data;
                IsolatedStorageSettings.ApplicationSettings.Save();
            }
        }

        public static PerformanceData Data = new PerformanceData();

        private PerformanceData()
        {
            Performances = new Dictionary<string, List<Performance>>();
        }


    }





}
